using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Overlay
{
    /// <summary>
    /// <para>Fuzzy Membership</para>
    /// <para>Transforms  the input raster   into a 0 to 1 scale, indicating the strength of a membership in a set, based on a specified fuzzification algorithm.</para>
    /// <para>根据指定的模糊化算法，将输入栅格转换为 0 到 1 的比例，以指示集合中成员的强度。</para>
    /// </summary>    
    [DisplayName("Fuzzy Membership")]
    public class FuzzyMembership : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public FuzzyMembership()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_raster">
        /// <para>Input raster</para>
        /// <para><xdoc>
        ///   <para>The input raster whose values will be scaled from 0 to 1.</para>
        ///   <para>It can be an integer or a floating-point raster.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>其值将从 0 缩放到 1 的输入栅格。</para>
        ///   <para>它可以是整数或浮点栅格。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_raster">
        /// <para>Output raster</para>
        /// <para>The output will be a floating-point raster with values ranging from 0 to 1.</para>
        /// <para>输出将为值范围为 0 到 1 的浮点栅格。</para>
        /// </param>
        public FuzzyMembership(object _in_raster, object _out_raster)
        {
            this._in_raster = _in_raster;
            this._out_raster = _out_raster;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Fuzzy Membership";

        public override string CallName => "sa.FuzzyMembership";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "configKeyword", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_raster, _out_raster, _fuzzy_function, _hedge.GetGPValue()];

        /// <summary>
        /// <para>Input raster</para>
        /// <para><xdoc>
        ///   <para>The input raster whose values will be scaled from 0 to 1.</para>
        ///   <para>It can be an integer or a floating-point raster.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>其值将从 0 缩放到 1 的输入栅格。</para>
        ///   <para>它可以是整数或浮点栅格。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_raster { get; set; }


        /// <summary>
        /// <para>Output raster</para>
        /// <para>The output will be a floating-point raster with values ranging from 0 to 1.</para>
        /// <para>输出将为值范围为 0 到 1 的浮点栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_raster { get; set; }


        /// <summary>
        /// <para>Membership type</para>
        /// <para><xdoc>
        ///   <para>Specifies the algorithm used in fuzzification of the input raster.</para>
        ///   <para>Certain settings for Membership type employ a Spread parameter to determine how rapidly the fuzzy membership values decrease from 1 to 0. The default values for the spread are detailed in the table below.</para>
        ///   <bulletList>
        ///     <bullet_item>Gaussian—Assigns a membership value of 1 at the midpoint.The membership decreases to 0 for values that deviate from the midpoint according to a normal curve. Gaussian is similar to the Near function but has a more narrow spread.
        ///     <bulletList>
        ///       <bullet_item>Midpoint — Default is the midpoint of the range of values of the input raster.  </bullet_item><para/>
        ///       <bullet_item>Spread — Default is 0.1. Typically, the values vary between [0.01–1].  </bullet_item><para/>
        ///     </bulletList>
        ///     </bullet_item><para/>
        ///     <bullet_item>Small—Used to indicate that small values of the input raster have high membership in the fuzzy set.Assigns a membership value of 0.5 at the midpoint.
        ///     <bulletList>
        ///       <bullet_item>Midpoint — Default is the midpoint of the range of values of the input raster.  </bullet_item><para/>
        ///       <bullet_item>Spread — Default is 5.  </bullet_item><para/>
        ///     </bulletList>
        ///     </bullet_item><para/>
        ///     <bullet_item>Large—Used to indicate that large values of the input raster have high membership in the fuzzy set.Assigns a membership value of 0.5 at the midpoint.
        ///     <bulletList>
        ///       <bullet_item>Midpoint — Default is the midpoint of the range of values of the input raster.  </bullet_item><para/>
        ///       <bullet_item>Spread — Default is 5.  </bullet_item><para/>
        ///     </bulletList>
        ///     </bullet_item><para/>
        ///     <bullet_item>Near—Calculates memberships for values near some intermediate value.Assigns a membership value of 1 at the midpoint. The membership decreases to 0 for values that deviate from the midpoint.
        ///     <bulletList>
        ///       <bullet_item>Midpoint — Default is the midpoint of the range of values of the input raster.  </bullet_item><para/>
        ///       <bullet_item>Spread — Default is 0.1. Typically, the values vary within the range of [0.001–1].  </bullet_item><para/>
        ///     </bulletList>
        ///     </bullet_item><para/>
        ///     <bullet_item>MSLarge—Calculates membership based on the mean and standard deviation of the input data where large values have high membership. The result can be similar to the Large function, depending on how the multipliers of the mean and standard deviation are defined.
        ///     <bulletList>
        ///       <bullet_item>Mean multiplier — Default is 1.  </bullet_item><para/>
        ///       <bullet_item>Standard deviation multiplier — Default is 2.  </bullet_item><para/>
        ///     </bulletList>
        ///     </bullet_item><para/>
        ///     <bullet_item>MSSmall—Calculates membership based on the mean and standard deviation of the input data where small values have high membership. This is the default membership type. The result can be similar to the Small function, depending on how the multipliers of the mean and standard deviation are defined.
        ///     <bulletList>
        ///       <bullet_item>Mean multiplier — Default is 1.  </bullet_item><para/>
        ///       <bullet_item>Standard deviation multiplier — Default is 2.  </bullet_item><para/>
        ///     </bulletList>
        ///     </bullet_item><para/>
        ///     <bullet_item>Linear—Calculates membership based on the linear transformation of the input raster. Assigns a membership value of 0 at the minimum and a membership of 1 at the maximum.
        ///     <bulletList>
        ///       <bullet_item>Minimum — Default is 1.  </bullet_item><para/>
        ///       <bullet_item>Maximum — Default is 2.  </bullet_item><para/>
        ///     </bulletList>
        ///     </bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定用于对输入栅格进行模糊化时使用的算法。</para>
        ///   <para>成员资格类型的某些设置使用 Spread 参数来确定模糊成员资格值从 1 减少到 0 的速度。点差的默认值详见下表。</para>
        ///   <bulletList>
        /// <bullet_item>高斯 - 在中点处分配隶属度值 1。对于根据正态曲线偏离中点的值，隶属度将减少到 0。Gaussian 类似于 Near 函数，但分布更窄。
        ///     <bulletList>
        ///       <bullet_item>中点 - 默认值为输入栅格值范围的中点。</bullet_item><para/>
        ///       <bullet_item>点差 — 默认值为0.1。通常，这些值在 [0.01–1] 之间变化。 </bullet_item><para/>
        ///     </bulletList>
        ///     </bullet_item><para/>
        /// <bullet_item>小 - 用于指示输入栅格的小值在模糊集中具有较高的隶属度。在中点分配成员资格值 0.5。
        ///     <bulletList>
        ///       <bullet_item>中点 - 默认值为输入栅格值范围的中点。</bullet_item><para/>
        ///       <bullet_item>点差 — 默认值为5。</bullet_item><para/>
        ///     </bulletList>
        ///     </bullet_item><para/>
        /// <bullet_item>大 - 用于指示输入栅格的大值在模糊集中具有较高隶属度。在中点分配成员资格值 0.5。
        ///     <bulletList>
        ///       <bullet_item>中点 - 默认值为输入栅格值范围的中点。</bullet_item><para/>
        ///       <bullet_item>点差 — 默认值为5。</bullet_item><para/>
        ///     </bulletList>
        ///     </bullet_item><para/>
        /// <bullet_item>近似值 （Near） - 计算某个中间值附近的值的隶属度。在中点分配成员资格值 1。对于偏离中点的值，成员资格将减少到 0。
        ///     <bulletList>
        ///       <bullet_item>中点 - 默认值为输入栅格值范围的中点。</bullet_item><para/>
        ///       <bullet_item>点差 — 默认值为0.1。通常，这些值在 [0.001–1] 范围内变化。 </bullet_item><para/>
        ///     </bulletList>
        ///     </bullet_item><para/>
        /// <bullet_item>MSLarge - 根据输入数据的平均值和标准差计算成员资格，其中大值具有较高的成员资格。结果可能类似于 Large 函数，具体取决于均值和标准差的乘数的定义方式。
        ///     <bulletList>
        ///       <bullet_item>均值乘数 — 默认值为 1。</bullet_item><para/>
        ///       <bullet_item>标准差乘数 — 默认值为 2。</bullet_item><para/>
        ///     </bulletList>
        ///     </bullet_item><para/>
        /// <bullet_item>MSSmall - 根据输入数据的平均值和标准差计算成员资格，其中小值具有较高成员资格。这是默认成员身份类型。结果可能类似于 Small 函数，具体取决于均值和标准差的乘数的定义方式。
        ///     <bulletList>
        ///       <bullet_item>均值乘数 — 默认值为 1。</bullet_item><para/>
        ///       <bullet_item>标准差乘数 — 默认值为 2。</bullet_item><para/>
        ///     </bulletList>
        ///     </bullet_item><para/>
        /// <bullet_item>线性 - 根据输入栅格的线性变换计算隶属度。分配最小成员资格值为 0，最大成员资格值为 1。
        ///     <bulletList>
        ///       <bullet_item>最小值 — 默认值为 1。</bullet_item><para/>
        ///       <bullet_item>最大值 — 默认值为2。</bullet_item><para/>
        ///     </bulletList>
        ///     </bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Membership type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _fuzzy_function { get; set; } = null;


        /// <summary>
        /// <para>Hedge</para>
        /// <para><xdoc>
        ///   <para>Defining a hedge increases or decreases the fuzzy membership values which modify the meaning of a fuzzy set. Hedges are useful to help in controlling the criteria or important attributes.</para>
        ///   <bulletList>
        ///     <bullet_item>None—No hedge is applied. This is the default.</bullet_item><para/>
        ///     <bullet_item>Somewhat—Known as dilation, defined as the square root of the fuzzy membership function. This hedge increases the fuzzy membership functions.</bullet_item><para/>
        ///     <bullet_item>Very—Also known as concentration, defined as the fuzzy membership function squared. This hedge decreases the fuzzy membership functions.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>定义对冲会增加或减少模糊隶属度值，从而修改模糊集的含义。套期保值有助于控制标准或重要属性。</para>
        ///   <bulletList>
        ///     <bullet_item>无 （None） - 不应用对冲。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>某种程度上 - 称为膨胀，定义为模糊隶属函数的平方根。此对冲增加了模糊隶属函数。</bullet_item><para/>
        ///     <bullet_item>非常 - 也称为浓度，定义为模糊隶属函数的平方。此对冲减少了模糊隶属函数。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Hedge")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _hedge_value _hedge { get; set; } = _hedge_value._NONE;

        public enum _hedge_value
        {
            /// <summary>
            /// <para>None</para>
            /// <para>None—No hedge is applied. This is the default.</para>
            /// <para>无 （None） - 不应用对冲。这是默认设置。</para>
            /// </summary>
            [Description("None")]
            [GPEnumValue("NONE")]
            _NONE,

            /// <summary>
            /// <para>Somewhat</para>
            /// <para>Somewhat—Known as dilation, defined as the square root of the fuzzy membership function. This hedge increases the fuzzy membership functions.</para>
            /// <para>某种程度上 - 称为膨胀，定义为模糊隶属函数的平方根。此对冲增加了模糊隶属函数。</para>
            /// </summary>
            [Description("Somewhat")]
            [GPEnumValue("SOMEWHAT")]
            _SOMEWHAT,

            /// <summary>
            /// <para>Very</para>
            /// <para>Very—Also known as concentration, defined as the fuzzy membership function squared. This hedge decreases the fuzzy membership functions.</para>
            /// <para>非常 - 也称为浓度，定义为模糊隶属函数的平方。此对冲减少了模糊隶属函数。</para>
            /// </summary>
            [Description("Very")]
            [GPEnumValue("VERY")]
            _VERY,

        }

        public FuzzyMembership SetEnv(int? autoCommit = null, object cellSize = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}